import json

gua = json.load(open('guaxiang.json', encoding="utf-8"))

assert len(gua) == 8+64, len(gua)
bagua = {}
for xiang in gua:
    if len(xiang) == 3:
        bagua[gua[xiang]] = xiang

for xiang in gua:
    if len(xiang) == 6:
        assert bagua[gua[xiang]['下']]+bagua[gua[xiang]['上']] == xiang, (xiang, gua[xiang])